<template>
  <div class="not-found-container">
    <div class="not-found-content">
      <div class="error-code">404</div>
      <h1 class="error-title">页面不存在</h1>
      <p class="error-description">
        抱歉，您访问的页面不存在或已被移动。
      </p>
      <div class="error-actions">
        <el-button type="primary" @click="goHome">
          <el-icon><House /></el-icon>
          返回首页
        </el-button>
        <el-button @click="goBack">
          <el-icon><Back /></el-icon>
          返回上页
        </el-button>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
import { House, Back } from '@element-plus/icons-vue'

const router = useRouter()

const goHome = () => {
  router.push('/')
}

const goBack = () => {
  router.go(-1)
}
</script>

<style scoped>
.not-found-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--dbu-gray-50), var(--dbu-gray-100));
  padding: var(--dbu-space-4);
}

.not-found-content {
  text-align: center;
  max-width: 500px;
}

.error-code {
  font-size: 8rem;
  font-weight: 700;
  color: var(--dbu-gray-400);
  line-height: 1;
  margin-bottom: var(--dbu-space-6);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.error-title {
  font-size: var(--dbu-text-3xl);
  font-weight: 600;
  color: var(--dbu-gray-800);
  margin-bottom: var(--dbu-space-4);
}

.error-description {
  font-size: var(--dbu-text-base);
  color: var(--dbu-gray-600);
  margin-bottom: var(--dbu-space-8);
  line-height: 1.6;
}

.error-actions {
  display: flex;
  gap: var(--dbu-space-4);
  justify-content: center;
}

@media (max-width: 480px) {
  .error-code {
    font-size: 6rem;
  }

  .error-title {
    font-size: var(--dbu-text-2xl);
  }

  .error-actions {
    flex-direction: column;
    align-items: center;
  }
}
</style>